
<%@ page import="sige.Pagamento" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'relatorioMensal.label', default: 'Relatório Mensal')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
        <div id="show-relatorioMesal" role="main">
            <center>
              <h1><g:message code="default.show.label" args="[entityName]" /></h1>
            </center>
            <g:if test="${flash.message}">
              <div class="alert alert-info">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                ${flash.message}
              </div>
            </g:if>
            <div class="span9 offset3">
		        <g:form action="show" class="form-inline well">
		            <div class="form-group">
                        <label class="sr-only" for="mes">Mês de Referência</label>
                        <g:myDatePicker name="mes" class="form-control" id="mes" value="${mes}" precision="month"/>
                        <button type="submit" class="btn btn-primary">
                            <i class="icon-search icon-white"></i>
                        </button>
                    </div>
		        </g:form>
		        <div>
		        
		            <!------------------------- RECEITAS-------------------------->
		            <table class="table table-striped table-hover">
	                    <thead>
		                    <tr>
			                    <th><g:message code="default.receita.label" default="Receita" /></th>
			                    
		                        <th><g:message code="pagamento.total.label" default="Total" /></th>
		                    </tr>
	                    </thead>
	                    <tbody>
	                    <g:each in="${receitasInstance}" status="i" var="item">
		                    <tr>
			                    <td><g:link action="porOrdem" params="[ordem: item.key, mes: mes]">${item.key}</g:link></td>
		
			                    <td><g:formatNumber number="${item.value}" type="currency" currencyCode="BRL" /></td>
		                    </tr>
	                    </g:each>
	                        <tr class="alert alert-success">
	                            <td><b><g:message code="pagamento.total.label" default="Total" /></b></td>
		                        <td><b><g:formatNumber number="${receitasTotal}" type="currency" currencyCode="BRL" /></b></td>
		                        
	                        </tr>
	                    </tbody>
                    </table>
		            
		            <!------------------------- DESPESAS-------------------------->
		            <table class="table table-striped table-hover">
	                    <thead>
		                    <tr>
			                    <th><g:message code="default.despesa.label" default="Despesa" /></th>
			                    
		                        <th><g:message code="pagamento.total.label" default="Total" /></th>
		                    </tr>
	                    </thead>
	                    <tbody>
	                    <g:each in="${despesasInstance}" status="i" var="item">
		                    <tr>
			                    <td><g:link action="porOrdem" params="[ordem: item.key, mes: mes]">${item.key}</g:link></td>
		
			                    <td><g:formatNumber number="${item.value}" type="currency" currencyCode="BRL" /></td>
		                    </tr>
	                    </g:each>
	                        <tr class="alert alert-danger">
	                            <td><b><g:message code="pagamento.total.label" default="Total" /></b></td>
		                        <td><b><g:formatNumber number="${despesasTotal}" type="currency" currencyCode="BRL" /></b></td>
	                        </tr>
	                    </tbody>
                    </table>
		        </div>
		        <g:form>
			        <fieldset class="form-actions">
				        <g:link class="btn btn-primary" action="edit">
				            <i class="icon-print icon-white"></i>
				            <g:message code="relatorioMensal.baixar.label" default="Baixar PDF" />
				        </g:link>
			        </fieldset>
		        </g:form>
            </div><!--/span8-->
	    </div><!--/show-professor-->
	</body>
</html>
